package io;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

/**
 * 使用对象流进对象行序列化
 */
public class OOSDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("Person.obj");
        ObjectOutputStream oos=new ObjectOutputStream(fos);
        Person p=new Person();
        p.setName("江南");
        p.setAge(18);
        p.setGender("女");
        p.setOtherInfo(new String []{
                "人美","心善","温柔"
        });
        oos.writeObject(p);
        System.out.println("输入完毕");
        oos.close();
    }
}
